<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>ActionMailer::LogSubscriber</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Class</span> 
            ActionMailer::LogSubscriber 
            
                <span class="parent">&lt; 
                    
                    <a href="../ActiveSupport/LogSubscriber.html">ActiveSupport::LogSubscriber</a>
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../../files/actionmailer/lib/action_mailer/log_subscriber_rb.html">actionmailer/lib/action_mailer/log_subscriber.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>D</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="LogSubscriber.html#method-i-deliver">deliver</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>L</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="LogSubscriber.html#method-i-logger">logger</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>R</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="LogSubscriber.html#method-i-receive">receive</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  



  

    

    

    


    


    <!-- Methods -->
        
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-deliver">
            
              <b>deliver</b>(event)
            
            <a href="LogSubscriber.html#method-i-deliver" name="method-i-deliver" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-deliver_source')" id="l_method-i-deliver_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/37852726c93541aa1adc014cfb862659c9bcf349/actionmailer/lib/action_mailer/log_subscriber.rb#L3" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-deliver_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionmailer/lib/action_mailer/log_subscriber.rb, line 3</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">deliver</span>(<span class="ruby-identifier">event</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info?</span>
  <span class="ruby-identifier">recipients</span> = <span class="ruby-constant">Array</span>(<span class="ruby-identifier">event</span>.<span class="ruby-identifier">payload</span>[<span class="ruby-value">:to</span>]).<span class="ruby-identifier">join</span>(<span class="ruby-string">', '</span>)
  <span class="ruby-identifier">info</span>(<span class="ruby-node">&quot;\nSent mail to #{recipients} (#{event.duration.round(1)}ms)&quot;</span>)
  <span class="ruby-identifier">debug</span>(<span class="ruby-identifier">event</span>.<span class="ruby-identifier">payload</span>[<span class="ruby-value">:mail</span>])
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-logger">
            
              <b>logger</b>()
            
            <a href="LogSubscriber.html#method-i-logger" name="method-i-logger" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-logger_source')" id="l_method-i-logger_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/37852726c93541aa1adc014cfb862659c9bcf349/actionmailer/lib/action_mailer/log_subscriber.rb#L16" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-logger_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionmailer/lib/action_mailer/log_subscriber.rb, line 16</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">logger</span>
  <span class="ruby-constant">ActionMailer</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">logger</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-receive">
            
              <b>receive</b>(event)
            
            <a href="LogSubscriber.html#method-i-receive" name="method-i-receive" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-receive_source')" id="l_method-i-receive_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/37852726c93541aa1adc014cfb862659c9bcf349/actionmailer/lib/action_mailer/log_subscriber.rb#L10" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-receive_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionmailer/lib/action_mailer/log_subscriber.rb, line 10</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">receive</span>(<span class="ruby-identifier">event</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info?</span>
  <span class="ruby-identifier">info</span>(<span class="ruby-node">&quot;\nReceived mail (#{event.duration.round(1)}ms)&quot;</span>)
  <span class="ruby-identifier">debug</span>(<span class="ruby-identifier">event</span>.<span class="ruby-identifier">payload</span>[<span class="ruby-value">:mail</span>])
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    